using System;
using System.Collections.Generic;
using System.Text;

namespace usm.SolDev.DataBase.DataAccess
{
    public class DataProvider
    {
        #region Private data
        private static DataProvider instanceObject = null;
        MySQLDataProvider mySqlDatabase;
        #endregion

        #region C'tor
        /// <summary>
        ///     Default constructor (hide it for a singleton class)
        /// </summary>
        private DataProvider()
        {
            mySqlDatabase = new MySQLDataProvider();
        }
        #endregion
        
        /// <summary>
        ///     Create an instance of DataProvider class and return underlaying
        /// data provider (mySQL in this implementation).
        /// </summary>
        public static IDataProvider DataBase
        {
            get
            { 
                if (instanceObject == null)
                {
                    instanceObject = new DataProvider();
                }

                return instanceObject.mySqlDatabase;
            }
        }
    }
}
